package com.derive.education_service.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * swagger2接口文档
 * @author xieyingde
 */
@Configuration
@EnableSwagger2
public class Swagger2Config {
    @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                //swagger要扫描的包路径
                .apis(RequestHandlerSelectors.basePackage("com.derive.education_service"))
                .paths(PathSelectors.any())
                .build().apiInfo(new ApiInfoBuilder()
                        .title("'衍界_国立教育服务平台'接口文档")
                        .description("衍界_国立教育服务平台接口文档")
                        .version("1.0v")
                        .contact(new Contact("sinder","www.xxx.com","597241326@qq.com"))
                        .build()
                );

    }
}
